﻿using ELTE.SEM.Common.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ELTE.SEM.Data.ViewModels
{
    public class RangeSelectorViewModel
    {
        public RangeSelectionType RangeType { get; set; }
        public int From { get; set; }
        public int To { get; set; }
        public List<string> Labels { get; set; }
        public int Default { get; set; }

        public RangeSelectorViewModel(RangeSelectionType rangeType)
        {
            RangeType = rangeType;
            switch (rangeType)
            {
                case RangeSelectionType.Minute:
                    From = 0;
                    To = 59;
                    Default = 0;
                    break;
                case RangeSelectionType.Hour:
                    From = 0;
                    To = 23;
                    Default = DateTime.Now.Hour;
                    break;
                case RangeSelectionType.Day:
                    From = 1;
                    To = 31;
                    Default = DateTime.Now.Day;
                    Labels = new List<string> { "Hétfő", "Kedd", "Szerda", "Csütörtök", "Péntek", "Szombat", "Vasárnap" };
                    break;
                case RangeSelectionType.Month:
                    From = 1;
                    To = 12;
                    Default = DateTime.Now.Month;
                    Labels = new List<string> { "Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December" };
                    break;
                case RangeSelectionType.Year:
                    From = 2010;
                    To = DateTime.Now.Year;
                    Default = DateTime.Now.Year;
                    break;
            }
        }
    }
}
